package cn.big.bigd.biocode.service;

import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * Created by wangfan on 2017/12/4.
 */
@Service
public class CreditService {
    @PersistenceContext
    private EntityManager entityManager;
//
//    public List<Credit> findDistinctToolByUser(User u) {
//
//        CriteriaBuilder cb =entityManager.getCriteriaBuilder();
//        CriteriaQuery<Credit> c =cb.createQuery(Credit.class);
//
//
//        String sql="SELECT releases.*,tools.name FROM releases INNER JOIN tools ON tools.id=releases.tool_id ORDER BY releases.created_at DESC ";
//        Query query=entityManager.createNativeQuery(sql);
//        query.unwrap(SQLQuery.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);//设置按照数据库字段返回map 结果集
//
//        List<Map<String, Object>> listRe= query.getResultList();
//        return listRe;
//    }
}
